//创建一个路由，并暴露出去
//第一步：引入路由器
import {createRouter,createWebHistory} from 'vue-router';
//引入路由组件
import Student from '../pages/Student.vue'
import Home from '../pages/Home.vue'
import Update from '../pages/Update.vue'

//第二步：创建路由器
const router =createRouter({
    history:createWebHistory(),
    //路由规则
    routes:[
        {
            name:'student',
            path:'/student',
            component:Student
        },
        {
            name:'home',
            path:'/home',
            component:Home
        },
        {
            path:'/',
            redirect:'/home'
        },
        {
            name:'update',
            path:'/update',
            component:Update
        }
    ]
})

export default router